package com.memg.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//2第二步：定义控制器
//2.1使用@Controller注解定义bean
@Controller
public class UserController {
    // 2.2 设置当前方法访问路径
    @RequestMapping("/save")

    // 2.3设置当前方法返回值类型
    @ResponseBody
    public String save(){
        System.out.println("user save,请求成功 save...");
        return "{'module':'springmvc'}";
    }


    @RequestMapping("/delete")

    // 2.3设置当前方法返回值类型
    @ResponseBody
    public String delete(){
        System.out.println("user save,请求成功 save...");
        return "{'module':'springmvc'}";
    }


}
